import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { DictTypeEntity } from "./dict-type.entity";
import { BaseEntity } from "../cores/entry.core/base.entity";

@Entity("webxue_dict_data")
export class DictDataEntity extends BaseEntity {

  @Column({ type: "varchar", comment: "字典类型" })
  @ManyToOne(() => DictTypeEntity, dictType => dictType.dictDatas)
  @JoinColumn({ name: "dict_type",referencedColumnName:"dict_type" })
  dict_type: string;

  @Column({ type: "varchar", length: 300, comment: "字典值名称" })
  dict_label: string;

  @Column({ type: "varchar", length: 300, comment: "字典值" })
  dict_value: string;
}
